import {
	baseUrl
} from "./https.js"
export const uploadFilePromise =  function (url) {
	return new Promise((resolve, reject) => {
		let a = uni.uploadFile({
			url: baseUrl + 'upload', // 仅为示例，非真实的接口地址
			filePath: url,
			name: 'file',
			header: {
				'content-type': 'application/form-data',
				'x-app-id': '10028',
				'x-token': uni.getStorageSync('Token'),
				'x-version': uni.getStorageSync("saveAllList").appVersion,
				'x-platform': uni.getStorageSync("saveAllList").osName,
				'x-device-id': uni.getStorageSync("saveAllList").deviceId,
				'x-channel': uni.getStorageSync('channel'),
				'x-mobile-brand': uni.getStorageSync("saveAllList").brand || "",
				'x-mobile-model': uni.getStorageSync("saveAllList").model,
				'x-user-agent': '4051322344813113401',
			},
			success: (res) => {
				resolve(JSON.parse(res.data).data)
			}
		});
	})
}